home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 3_16.lha / 3_16 / 3_16c.c < prev    next >
Text File  |  1993-08-08  |  476b  |  28 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. * handle a block comment */
  6. oid doblockcomment()
  7.  
  8.    cout.put(' ');
  9.    char ch;
  10.  
  11.    // loop until matching */
  12.    while (cin.get(ch))
  13. if (ch == '*')
  14.     {
  15.     cin.get(ch);
  16.     if (!cin)
  17.     break;
  18.     if (ch == '/')
  19.     return;
  20.     cin.putback(ch);
  21.     }
  22.  
  23. else if (ch == '\n')
  24.     cout.put(ch);
  25.  
  26.    error("EOF found within full comment");
  27.  
  28.